package org.example.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(name = "producer", path = "/")
public interface ProducerFeign {
    // openfeign会自动转get成post，一定需要加注解并指定参数名称
    @GetMapping(value = "/do-get")
    String doGet(@RequestParam("name") String name);

    @PostMapping(value = "/do-post")
    String doPost(@RequestBody Map<String, Object> body);
}
